Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for #1504 PSUseUsingScopeModifierInNewRunspaces #2005

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

o-l-a-v
Copy link

@o-l-a-v o-l-a-v commented May 27, 2024

PR Summary

Wrote two tests for issue #1504. The issue is not fixed yet, but I had two scenarios that could easily be added to the relevant test file.

Repro to wrongfully trigger PSUseUsingScopeModifierInNewRunspaces, which I added to test:

# Microsoft.PowerShell.Core \ Start-Job
Start-Job -ScriptBlock {
    Param($Foo)
    $Foo
} -ArgumentList 'Bar' | Receive-Job -Wait -AutoRemoveJob

# Microsoft.PowerShell.ThreadJob
Start-ThreadJob -ScriptBlock {
    Param($Foo)
    $Foo
} -ArgumentList 'Bar' | Receive-Job -Wait -AutoRemoveJob

PR Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant